package org.opens.kafka.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MessageListener {

    @KafkaListener(topics = "test-kafka")
    public void onMessage(ConsumerRecord<String, String> record) {
        log.info("收到kafka消息: {}", record.value());
    }

}
